module RuSSY
  class PageBase
    @pageparts

    def initialize
      @pageparts = Hash.new
    end

    def verify_allpageparts
       @pageparts.each {|key, pagepart| pagepart.verify }
    end

    def verify_pagepart_byname(pagepartname)
      @pageparts[pagepartname].verify
    end

    def add_pagepart(key, pagepart)
      @pageparts[key] = pagepart
    end

    def update_pagepart(key, pagepart)
      add_pagepart(key, pagepart)
    end

    def delete_pagepart(key)
      @pageparts.delete(key)
    end
  end
end
